package com.ericsson.common.quartz.job;

import com.ericsson.enap.modules.monitor.entity.EpcCron;
import com.ericsson.common.util.TaskUtils;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;


//当上一个任务未结束时下一个任务需进行等待
@DisallowConcurrentExecution
@Component
public class MyJob implements Job {

    //每10条日志进行一下落地
    private final static Integer SIZE=9;

    //execute会根据cron的规则进行执行
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        EpcCron config = (EpcCron) jobExecutionContext.getMergedJobDataMap().get("SCHEDULEJOB");
        TaskUtils.invokMethod(config);
    }

}
